/************************************
 * Package: RGcpp					*
 * Authors: Rui Eduardo Gouveia Gil	*
 * Date: 2010						*
 ************************************/
#ifndef __RGCPP_THREADPOOLINTERFACE_H__
#define __RGCPP_THREADPOOLINTERFACE_H__

namespace rgcpp
{

enum TPPLevel
{
	TPP_VERY_LOW = 0,
	TPP_LOW,
	TPP_NORMAL,
	TPP_HIGH,
	TPP_VERY_HIGH
};

class ThreadPoolInterface
{
	private:
		TPPLevel priority;

	public:
		ThreadPoolInterface();
		virtual ~ThreadPoolInterface();

		virtual bool execute(void* buffer);
		virtual bool final();

		TPPLevel getPriority();
		void setPriority(TPPLevel priority);

		friend bool operator!=(const ThreadPoolInterface& o1, const ThreadPoolInterface& o2)
		{
			return o1.priority!=o2.priority;
		}

		friend bool operator==(const ThreadPoolInterface& o1, const ThreadPoolInterface& o2)
		{
			return o1.priority==o2.priority;
		}

		friend bool operator<(const ThreadPoolInterface& o1, const ThreadPoolInterface& o2)
		{
			return o1.priority<=o2.priority;
		}

		friend bool operator>(const ThreadPoolInterface& o1, const ThreadPoolInterface& o2)
		{
			return o1.priority>o2.priority;
		}

		friend bool operator<=(const ThreadPoolInterface& o1, const ThreadPoolInterface& o2)
		{
			return o1.priority<o2.priority;
		}

		friend bool operator>=(const ThreadPoolInterface& o1, const ThreadPoolInterface& o2)
		{
			return o1.priority>=o2.priority;
		}

};

}

#endif
